-
-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue 229 - New-JiraIssue should take params from pipeline. #312
Conversation
Issue was due to begin and end blocks using params. Added test for params from pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job.
Please fix the two comments and I will merge
JiraPS/Public/New-JiraIssue.ps1
Outdated
[PSCustomObject] | ||
$Fields, | ||
|
||
[Parameter()] | ||
[Parameter( ValueFromPipelineByPropertyName )] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Credential
is not part of any object that can be used in the pipeline.
please remove this change
JiraPS/Public/New-JiraIssue.ps1
Outdated
[System.Management.Automation.PSCredential] | ||
[System.Management.Automation.Credential()] | ||
$Credential = [System.Management.Automation.PSCredential]::Empty | ||
) | ||
|
||
begin { | ||
} | ||
|
||
process { | ||
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Function started" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please leave the Write-Verbose
of the beginning in the begin block
Removed credential from param by pipeline.
Description
The here was due to how PowerShell handles input via the pipeline, see an in depth explanation with examples here: https://learn-powershell.net/2013/05/07/tips-on-implementing-pipeline-support/.
The function will be unable to use $Profile in the begin block, so i moved that code into the Process block. This is necessary so that multiple new issues can be passed in and processed one after the other.
Motivation and Context
This resolves #229 and allows a user to fill an excel sheet or other object with new issues and pipe them into new issue.
closes #229
Types of changes
Checklist: